POV-Ray : Newsgroups : povray.newusers : Problems with photon mapping and transparancy : Problems with photon mapping and transparancy Server Time
28 Jul 2024 16:15:22 EDT (-0400)
  Problems with photon mapping and transparancy  
From: Killroy Quartermaine
Date: 11 Jul 2008 01:00:01
Message: <web.4876e86e5eef6c304cdc498c0@news.povray.org>
OK, so a little background.

POVRay is my first ray tracer, and with no background in three-dimensional
design or code-writing, and basically poor math skills, I've been having a
heckuva time teaching myself.

That said, what progress I've made, I've made just about entirely on my own, and
I've done some pretty snazzy stuff with simple abstracts using CSG. Just now I'm
working on building non-abstract objects, and I decided to start with a simple
task: A spherical bottle holding a quantity of clear water.

I had previously played a bit with ior values, and this time decided to play
with photon mapping as well.

So I build my bottle as a CSG object: a difference of two spheres merged with a
difference of two cylinders, with a torus for the lip. Then I chop a cut-to-
interior sized half sphere using a difference of a sphere and box.

The bottle renders perfectly on it's own. The "water" renders just fine on it's
own as well. Just about perfectly clear, with the right diffraction and
whatnot.

But when I render the two together, the water appears more like crude oil, and
while it makes a very pretty pattern with the  diffracted light from the
bottle, I was aiming for clear water.

Any help that you can offer would be much appreciated.

Oh, uh, here's the code... messy as it is:

//bottle 1. An attempt to create glass objects with properties of refraction,
hollow interiors, and whatnot.

include "colors.inc"
include "woods.inc"
include "metals.inc"
include "stones.inc"

 global_settings {
   photons {
     count 90000
     autostop 0
     jitter .4
   }
 }


camera {location<-5,3,-5> look_at<0,0,1>}

light_source {<-10,10,0>
         White
         area_light <1,0,0>, <0,0,1> 3,3 adaptive 1 jitter
         photons{area_light}
         }
light_source {<-10,10,0>
         White
         area_light <1,0,0>, <0,0,1> 3,3 adaptive 1 jitter
         photons{area_light}
         }

plane {<0,1,0>, -2 texture {T_Grnt11a} photons {target collect on}}

#declare ClosedBell = difference {
        sphere {<0,0,0>, 2}
        sphere {<0,0,0>, 1.85}
        }
#declare OpenBell = difference {
        object {ClosedBell}
        cylinder {<0,0,0> <0,2.1,0> .5 }
        }
#declare Stem = difference {
        cylinder {<0,1.9,0> <0,3.5,0> .5}
        cylinder {<0,1.89,0> <0,3.6,0> .35}
        }
#declare FinishStem = merge {
        object {Stem}
        torus {.5, .1399 translate <0,3.45,0>}
        }
#declare Bottle1 = merge {
        object {FinishStem}
        object {OpenBell}
        }
#declare Water1 = difference {
        sphere {<0,0,0>, 1.8499}
        box {<2,0,2> <-2,2,-2>}
        }

object {Water1
         pigment {rgbf <1,1,1,.9999>}
         interior {ior 1.01}
         photons {target reflection on refraction on}
         finish {ambient 2}
         }

object {Bottle1
         pigment {rgbf <.98,.90,.94,1>}
         finish {reflection .1 specular .3 roughness .01 diffuse.02}
         interior {ior 1.5 dispersion 1.1}
         photons { target reflection on refraction on}
         rotate <45,0,0>}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.